<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        td{
            width: 20px;
            height: 20px;
            border: 1px solid #666;
        }
        .bgRed{
            background-color: red;
        }
    </style>
</head>
<body>
    <table></table>
    <script>
        let data=[
            [{},{},{},{},{},{state:1},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
            [{},{},{},{},{},{},{},{},{},{},],
        ]
        let table= document.querySelector("table");
        data.forEach(v => {
            let tr = document.createElement('tr');
            v.forEach(v =>{
                let td = document.createElement('td');
                if(v.state === 1){
                    td.className = "bgRed"
                }
                tr.appendChild(td);
            })
            table.appendChild(tr);
        });
    </script>
</body>
</html>